package com.hmy.infrastructure.api.client.sms;

import com.hmy.ccp.common.result.FeignResult;
import com.hmy.infrastructure.api.bo.request.sms.CheckVerificationCodeRequest;
import com.hmy.infrastructure.api.bo.request.sms.SendVerificationCodeRequest;
import com.hmy.infrastructure.api.bo.request.sms.SmsRequest;
import com.hmy.infrastructure.api.bo.response.sms.CheckVerificationCodeResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("hmy-ccp-infrastructure")
public interface SmsClient {
    /**
     * 获取阿里云OSS临时认证
     *
     * @return OssCredentialsResponse 返回临时认证数据
     */
    @PostMapping("/feign/sms/send")
    FeignResult<Boolean> send(@RequestBody SmsRequest smsRequest);

    /**
     * 发送验证码
     *
     * @param sendVerificationCodeRequest 发送验证码参数
     * @return 是否发送成功
     */
    @PostMapping("/feign/sms/sendVerificationCode")
    FeignResult<Boolean> sendVerificationCode(@RequestBody @Validated SendVerificationCodeRequest sendVerificationCodeRequest);

    /**
     * 发送验证码
     *
     * @param checkVerificationCodeRequest 校验验证码参数
     * @return 校验结果
     */
    @PostMapping("/feign/sms/checkVerificationCode")
    FeignResult<CheckVerificationCodeResponse> checkVerificationCode(@RequestBody @Validated CheckVerificationCodeRequest checkVerificationCodeRequest);

}
